﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuMianChaZhi.Contour
{
    public class Edge
    {
        public String Key { get; set; }
        public VPoint P1 { get; set; }

        public VPoint P2 { get; set; }

        public Triangle Triangle1 { get; set; }

        public Triangle Triangle2 { get; set; }

        public bool IsBorder
        {
            get
            {
                return Triangle2 == null;
            }
        }

        public override bool Equals(object obj)
        {
            if (obj is Edge)
            {
                Edge tmp = obj as Edge;
                return this.P1 == tmp.P1 && this.P2 == tmp.P2;
            }
            return false;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
